#include <QCoreApplication>
#include <iostream>
#include<math.h>
using namespace std;

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    {
    int N;
    double s,A,x;
    cin >> x;
    if ((x < 1) && (x > 0))
    {
      cin >> N;
      if (N > 0)
      {
        s = 0;
        A = 1;
        for (int i = 1; i <= N; i++ )
        {
          A = - A * x;
      s = s + A / i;
        }
        cout << log(x + 1) ;
        cout << s ;
  }
    }
    }
    return a.exec();
}
